<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         var name = 'window';
        var obj1 = {
            name:'1',
            fn1:function (){
                console.log(this.name);
            },
            fn2:()=>console.log(this.name),
            fn3: function (){
                return function (){
                    console.log(this.name);
                }
            },
            fn4: function(){
                return () => console.log(this.name);
            }
        };
        var obj2 = {
            name: '2'
        };

    </script>
</body>
</html>